package es.ats.codington.festival.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import es.ats.codington.festival.domain.Event;



public class EventMapper implements RowMapper<Event>{

	@Override
	public Event mapRow(ResultSet resultSet, int numRow) throws SQLException {
		Event event = new Event();
		event.setIdEvent(resultSet.getInt("idEvent"));
		event.setEventName(resultSet.getString("eventName"));
		event.setDescription(resultSet.getString("description"));
		
		event.setPlace(resultSet.getString("place"));
		event.setEventType(resultSet.getString("eventType"));
		event.setDuration(resultSet.getInt("duration"));
		event.setSeatsAvailable(resultSet.getInt("seatsAvailable"));
		event.setSeatsTotal(resultSet.getInt("seatsTotal"));
		
	
		return event;
	}

}
